home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 2.9 KB | 112 lines | [TEXT/KAHL] |
- $$Message MM Modal Dialog, mm:mmModalDialogObject.cp
- $$File mm:mmModalDialogObject.cp
- /* mmModalDialogObject */
- /* $CopyRight$ */
-
- /* File name: mmModalDialogObject
- Function: Basic modal dialog object
-
- History: $Date$ Original by $Author$
-
- */
-
- #include "mmCommon$Prototype.name$.h" /* Common */
- #include "Common$Prototype.name$.h" /* Common */
-
-
- /* ======================================================= */
- /* ======================================================= */
-
- Boolean CmmModalDialog::FilterThisEvent(DialogPtr theDialog,EventRecord *theEvent,short *itemHit)
- {
- Boolean FilterItOut;
- /* Expected to be overridden by the dialog code */
- FilterItOut = false;
- return(FilterItOut);
- }
-
- /* ======================================================= */
-
- void CmmModalDialog::FilterMouseDown(DialogPtr theDialog,EventRecord *theEvent,short *itemHit,Point MyPt)
- {
- /* Expected to be overridden by the dialog code */
- }
-
- /* ======================================================= */
-
- /* Routine: MyFilter */
- /* Purpose: Filter routine, also used for initial setup of dimmed states */
-
- pascal Boolean theModalDialogFilter(DialogPtr theDialog,EventRecord *theEvent,short *itemHit)
- {
- Boolean FilterValue; /* Temporary return value */
- Point MyPt;
-
-
- FilterValue = false;
- if (gCurrentModalDialog != nil)
- {
- FilterValue = gCurrentModalDialog->FilterThisEvent(theDialog,theEvent,itemHit);
-
- /* Only do on an update */
- if ((theEvent->what == updateEvt) && ((WindowPtr)theEvent->message == theDialog))
- {
- BeginUpdate(theDialog); /* Start the update */
- DrawDialog(theDialog); /* Draw the controls */
- FilterValue = true; /* Pass out this special itemHit number */
- *itemHit = 32000; /* Our special ID */
- }
-
- if (theEvent->what == mouseDown) /* Only do on a mouse click */
- {
- MyPt = theEvent->where; /* Get the point where the mouse was clicked */
- GlobalToLocal(&MyPt); /* Convert global to local */
-
- gCurrentModalDialog->FilterMouseDown(theDialog,theEvent,itemHit,MyPt);
- }
-
- CheckKeysInDialog(theDialog,&FilterValue,theEvent,itemHit);
- }
-
- return(FilterValue);
- }
-
- /* ======================================================= */
-
- void CmmModalDialog::Init()
- {
-
- inherited::Init();
-
- this->theWindow = nil;
- this->ExitDialog = false;
- /* Expected to be overridden by the dialog code */
- }
-
- /* ======================================================= */
-
- void CmmModalDialog::ExtraSetup()
- {
- /* Expected to be overridden by the dialog code */
- }
-
- /* ======================================================= */
-
- void CmmModalDialog::DoItemHit(short *itemHit,Boolean *ExitDialog)
- {
- /* Expected to be overridden by the dialog code */
- }
-
- /* ======================================================= */
-
- void CmmModalDialog::Exit()
- {
- /* Expected to be overridden by the dialog code */
- }
-
- /* ======================================================= */
- /* ======================================================= */
- $$CloseFile
-
-
-